{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd\n",
    "from pycaret.regression import *"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "path = \"../data/train.csv\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "300000"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df = pd.read_csv(path)\n",
    "len(df)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Index(['id', 'cat0', 'cat1', 'cat2', 'cat3', 'cat4', 'cat5', 'cat6', 'cat7',\n",
       "       'cat8', 'cat9', 'cont0', 'cont1', 'cont2', 'cont3', 'cont4', 'cont5',\n",
       "       'cont6', 'cont7', 'cont8', 'cont9', 'cont10', 'cont11', 'cont12',\n",
       "       'cont13', 'target'],\n",
       "      dtype='object')"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.columns"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [],
   "source": [
    "cat_col = ['cat0', 'cat1', 'cat2', 'cat3', 'cat4', 'cat5', 'cat6', 'cat7','cat8', 'cat9']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [],
   "source": [
    "cont_col = ['cont0', 'cont1', 'cont2', 'cont3', 'cont4', 'cont5','cont6', 'cont7', 'cont8', 'cont9', 'cont10', 'cont11', 'cont12','cont13']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<style  type=\"text/css\" >\n",
       "#T_6611ec1c_682f_11eb_9e2c_b42e99813c1arow29_col1{\n",
       "            background-color:  lightgreen;\n",
       "        }</style><table id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1a\" ><thead>    <tr>        <th class=\"blank level0\" ></th>        <th class=\"col_heading level0 col0\" >Description</th>        <th class=\"col_heading level0 col1\" >Value</th>    </tr></thead><tbody>\n",
       "                <tr>\n",
       "                        <th id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1alevel0_row0\" class=\"row_heading level0 row0\" >0</th>\n",
       "                        <td id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1arow0_col0\" class=\"data row0 col0\" >session_id</td>\n",
       "                        <td id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1arow0_col1\" class=\"data row0 col1\" >123</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1alevel0_row1\" class=\"row_heading level0 row1\" >1</th>\n",
       "                        <td id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1arow1_col0\" class=\"data row1 col0\" >Target</td>\n",
       "                        <td id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1arow1_col1\" class=\"data row1 col1\" >target</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1alevel0_row2\" class=\"row_heading level0 row2\" >2</th>\n",
       "                        <td id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1arow2_col0\" class=\"data row2 col0\" >Original Data</td>\n",
       "                        <td id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1arow2_col1\" class=\"data row2 col1\" >(300000, 26)</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1alevel0_row3\" class=\"row_heading level0 row3\" >3</th>\n",
       "                        <td id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1arow3_col0\" class=\"data row3 col0\" >Missing Values</td>\n",
       "                        <td id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1arow3_col1\" class=\"data row3 col1\" >False</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1alevel0_row4\" class=\"row_heading level0 row4\" >4</th>\n",
       "                        <td id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1arow4_col0\" class=\"data row4 col0\" >Numeric Features</td>\n",
       "                        <td id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1arow4_col1\" class=\"data row4 col1\" >14</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1alevel0_row5\" class=\"row_heading level0 row5\" >5</th>\n",
       "                        <td id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1arow5_col0\" class=\"data row5 col0\" >Categorical Features</td>\n",
       "                        <td id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1arow5_col1\" class=\"data row5 col1\" >10</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1alevel0_row6\" class=\"row_heading level0 row6\" >6</th>\n",
       "                        <td id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1arow6_col0\" class=\"data row6 col0\" >Ordinal Features</td>\n",
       "                        <td id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1arow6_col1\" class=\"data row6 col1\" >False</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1alevel0_row7\" class=\"row_heading level0 row7\" >7</th>\n",
       "                        <td id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1arow7_col0\" class=\"data row7 col0\" >High Cardinality Features</td>\n",
       "                        <td id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1arow7_col1\" class=\"data row7 col1\" >False</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1alevel0_row8\" class=\"row_heading level0 row8\" >8</th>\n",
       "                        <td id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1arow8_col0\" class=\"data row8 col0\" >High Cardinality Method</td>\n",
       "                        <td id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1arow8_col1\" class=\"data row8 col1\" >None</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1alevel0_row9\" class=\"row_heading level0 row9\" >9</th>\n",
       "                        <td id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1arow9_col0\" class=\"data row9 col0\" >Transformed Train Set</td>\n",
       "                        <td id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1arow9_col1\" class=\"data row9 col1\" >(209999, 67)</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1alevel0_row10\" class=\"row_heading level0 row10\" >10</th>\n",
       "                        <td id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1arow10_col0\" class=\"data row10 col0\" >Transformed Test Set</td>\n",
       "                        <td id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1arow10_col1\" class=\"data row10 col1\" >(90001, 67)</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1alevel0_row11\" class=\"row_heading level0 row11\" >11</th>\n",
       "                        <td id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1arow11_col0\" class=\"data row11 col0\" >Shuffle Train-Test</td>\n",
       "                        <td id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1arow11_col1\" class=\"data row11 col1\" >True</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1alevel0_row12\" class=\"row_heading level0 row12\" >12</th>\n",
       "                        <td id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1arow12_col0\" class=\"data row12 col0\" >Stratify Train-Test</td>\n",
       "                        <td id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1arow12_col1\" class=\"data row12 col1\" >False</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1alevel0_row13\" class=\"row_heading level0 row13\" >13</th>\n",
       "                        <td id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1arow13_col0\" class=\"data row13 col0\" >Fold Generator</td>\n",
       "                        <td id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1arow13_col1\" class=\"data row13 col1\" >KFold</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1alevel0_row14\" class=\"row_heading level0 row14\" >14</th>\n",
       "                        <td id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1arow14_col0\" class=\"data row14 col0\" >Fold Number</td>\n",
       "                        <td id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1arow14_col1\" class=\"data row14 col1\" >10</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1alevel0_row15\" class=\"row_heading level0 row15\" >15</th>\n",
       "                        <td id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1arow15_col0\" class=\"data row15 col0\" >CPU Jobs</td>\n",
       "                        <td id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1arow15_col1\" class=\"data row15 col1\" >-1</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1alevel0_row16\" class=\"row_heading level0 row16\" >16</th>\n",
       "                        <td id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1arow16_col0\" class=\"data row16 col0\" >Use GPU</td>\n",
       "                        <td id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1arow16_col1\" class=\"data row16 col1\" >False</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1alevel0_row17\" class=\"row_heading level0 row17\" >17</th>\n",
       "                        <td id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1arow17_col0\" class=\"data row17 col0\" >Log Experiment</td>\n",
       "                        <td id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1arow17_col1\" class=\"data row17 col1\" >False</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1alevel0_row18\" class=\"row_heading level0 row18\" >18</th>\n",
       "                        <td id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1arow18_col0\" class=\"data row18 col0\" >Experiment Name</td>\n",
       "                        <td id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1arow18_col1\" class=\"data row18 col1\" >reg-default-name</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1alevel0_row19\" class=\"row_heading level0 row19\" >19</th>\n",
       "                        <td id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1arow19_col0\" class=\"data row19 col0\" >USI</td>\n",
       "                        <td id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1arow19_col1\" class=\"data row19 col1\" >325f</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1alevel0_row20\" class=\"row_heading level0 row20\" >20</th>\n",
       "                        <td id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1arow20_col0\" class=\"data row20 col0\" >Imputation Type</td>\n",
       "                        <td id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1arow20_col1\" class=\"data row20 col1\" >simple</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1alevel0_row21\" class=\"row_heading level0 row21\" >21</th>\n",
       "                        <td id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1arow21_col0\" class=\"data row21 col0\" >Iterative Imputation Iteration</td>\n",
       "                        <td id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1arow21_col1\" class=\"data row21 col1\" >None</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1alevel0_row22\" class=\"row_heading level0 row22\" >22</th>\n",
       "                        <td id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1arow22_col0\" class=\"data row22 col0\" >Numeric Imputer</td>\n",
       "                        <td id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1arow22_col1\" class=\"data row22 col1\" >mean</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1alevel0_row23\" class=\"row_heading level0 row23\" >23</th>\n",
       "                        <td id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1arow23_col0\" class=\"data row23 col0\" >Iterative Imputation Numeric Model</td>\n",
       "                        <td id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1arow23_col1\" class=\"data row23 col1\" >None</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1alevel0_row24\" class=\"row_heading level0 row24\" >24</th>\n",
       "                        <td id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1arow24_col0\" class=\"data row24 col0\" >Categorical Imputer</td>\n",
       "                        <td id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1arow24_col1\" class=\"data row24 col1\" >constant</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1alevel0_row25\" class=\"row_heading level0 row25\" >25</th>\n",
       "                        <td id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1arow25_col0\" class=\"data row25 col0\" >Iterative Imputation Categorical Model</td>\n",
       "                        <td id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1arow25_col1\" class=\"data row25 col1\" >None</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1alevel0_row26\" class=\"row_heading level0 row26\" >26</th>\n",
       "                        <td id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1arow26_col0\" class=\"data row26 col0\" >Unknown Categoricals Handling</td>\n",
       "                        <td id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1arow26_col1\" class=\"data row26 col1\" >least_frequent</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1alevel0_row27\" class=\"row_heading level0 row27\" >27</th>\n",
       "                        <td id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1arow27_col0\" class=\"data row27 col0\" >Normalize</td>\n",
       "                        <td id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1arow27_col1\" class=\"data row27 col1\" >False</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1alevel0_row28\" class=\"row_heading level0 row28\" >28</th>\n",
       "                        <td id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1arow28_col0\" class=\"data row28 col0\" >Normalize Method</td>\n",
       "                        <td id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1arow28_col1\" class=\"data row28 col1\" >None</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1alevel0_row29\" class=\"row_heading level0 row29\" >29</th>\n",
       "                        <td id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1arow29_col0\" class=\"data row29 col0\" >Transformation</td>\n",
       "                        <td id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1arow29_col1\" class=\"data row29 col1\" >True</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1alevel0_row30\" class=\"row_heading level0 row30\" >30</th>\n",
       "                        <td id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1arow30_col0\" class=\"data row30 col0\" >Transformation Method</td>\n",
       "                        <td id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1arow30_col1\" class=\"data row30 col1\" >yeo-johnson</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1alevel0_row31\" class=\"row_heading level0 row31\" >31</th>\n",
       "                        <td id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1arow31_col0\" class=\"data row31 col0\" >PCA</td>\n",
       "                        <td id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1arow31_col1\" class=\"data row31 col1\" >False</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1alevel0_row32\" class=\"row_heading level0 row32\" >32</th>\n",
       "                        <td id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1arow32_col0\" class=\"data row32 col0\" >PCA Method</td>\n",
       "                        <td id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1arow32_col1\" class=\"data row32 col1\" >None</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1alevel0_row33\" class=\"row_heading level0 row33\" >33</th>\n",
       "                        <td id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1arow33_col0\" class=\"data row33 col0\" >PCA Components</td>\n",
       "                        <td id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1arow33_col1\" class=\"data row33 col1\" >None</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1alevel0_row34\" class=\"row_heading level0 row34\" >34</th>\n",
       "                        <td id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1arow34_col0\" class=\"data row34 col0\" >Ignore Low Variance</td>\n",
       "                        <td id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1arow34_col1\" class=\"data row34 col1\" >False</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1alevel0_row35\" class=\"row_heading level0 row35\" >35</th>\n",
       "                        <td id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1arow35_col0\" class=\"data row35 col0\" >Combine Rare Levels</td>\n",
       "                        <td id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1arow35_col1\" class=\"data row35 col1\" >False</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1alevel0_row36\" class=\"row_heading level0 row36\" >36</th>\n",
       "                        <td id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1arow36_col0\" class=\"data row36 col0\" >Rare Level Threshold</td>\n",
       "                        <td id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1arow36_col1\" class=\"data row36 col1\" >None</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1alevel0_row37\" class=\"row_heading level0 row37\" >37</th>\n",
       "                        <td id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1arow37_col0\" class=\"data row37 col0\" >Numeric Binning</td>\n",
       "                        <td id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1arow37_col1\" class=\"data row37 col1\" >False</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1alevel0_row38\" class=\"row_heading level0 row38\" >38</th>\n",
       "                        <td id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1arow38_col0\" class=\"data row38 col0\" >Remove Outliers</td>\n",
       "                        <td id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1arow38_col1\" class=\"data row38 col1\" >False</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1alevel0_row39\" class=\"row_heading level0 row39\" >39</th>\n",
       "                        <td id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1arow39_col0\" class=\"data row39 col0\" >Outliers Threshold</td>\n",
       "                        <td id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1arow39_col1\" class=\"data row39 col1\" >None</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1alevel0_row40\" class=\"row_heading level0 row40\" >40</th>\n",
       "                        <td id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1arow40_col0\" class=\"data row40 col0\" >Remove Multicollinearity</td>\n",
       "                        <td id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1arow40_col1\" class=\"data row40 col1\" >False</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1alevel0_row41\" class=\"row_heading level0 row41\" >41</th>\n",
       "                        <td id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1arow41_col0\" class=\"data row41 col0\" >Multicollinearity Threshold</td>\n",
       "                        <td id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1arow41_col1\" class=\"data row41 col1\" >None</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1alevel0_row42\" class=\"row_heading level0 row42\" >42</th>\n",
       "                        <td id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1arow42_col0\" class=\"data row42 col0\" >Clustering</td>\n",
       "                        <td id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1arow42_col1\" class=\"data row42 col1\" >False</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1alevel0_row43\" class=\"row_heading level0 row43\" >43</th>\n",
       "                        <td id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1arow43_col0\" class=\"data row43 col0\" >Clustering Iteration</td>\n",
       "                        <td id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1arow43_col1\" class=\"data row43 col1\" >None</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1alevel0_row44\" class=\"row_heading level0 row44\" >44</th>\n",
       "                        <td id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1arow44_col0\" class=\"data row44 col0\" >Polynomial Features</td>\n",
       "                        <td id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1arow44_col1\" class=\"data row44 col1\" >False</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1alevel0_row45\" class=\"row_heading level0 row45\" >45</th>\n",
       "                        <td id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1arow45_col0\" class=\"data row45 col0\" >Polynomial Degree</td>\n",
       "                        <td id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1arow45_col1\" class=\"data row45 col1\" >None</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1alevel0_row46\" class=\"row_heading level0 row46\" >46</th>\n",
       "                        <td id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1arow46_col0\" class=\"data row46 col0\" >Trignometry Features</td>\n",
       "                        <td id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1arow46_col1\" class=\"data row46 col1\" >False</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1alevel0_row47\" class=\"row_heading level0 row47\" >47</th>\n",
       "                        <td id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1arow47_col0\" class=\"data row47 col0\" >Polynomial Threshold</td>\n",
       "                        <td id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1arow47_col1\" class=\"data row47 col1\" >None</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1alevel0_row48\" class=\"row_heading level0 row48\" >48</th>\n",
       "                        <td id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1arow48_col0\" class=\"data row48 col0\" >Group Features</td>\n",
       "                        <td id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1arow48_col1\" class=\"data row48 col1\" >False</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1alevel0_row49\" class=\"row_heading level0 row49\" >49</th>\n",
       "                        <td id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1arow49_col0\" class=\"data row49 col0\" >Feature Selection</td>\n",
       "                        <td id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1arow49_col1\" class=\"data row49 col1\" >False</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1alevel0_row50\" class=\"row_heading level0 row50\" >50</th>\n",
       "                        <td id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1arow50_col0\" class=\"data row50 col0\" >Features Selection Threshold</td>\n",
       "                        <td id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1arow50_col1\" class=\"data row50 col1\" >None</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1alevel0_row51\" class=\"row_heading level0 row51\" >51</th>\n",
       "                        <td id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1arow51_col0\" class=\"data row51 col0\" >Feature Interaction</td>\n",
       "                        <td id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1arow51_col1\" class=\"data row51 col1\" >False</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1alevel0_row52\" class=\"row_heading level0 row52\" >52</th>\n",
       "                        <td id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1arow52_col0\" class=\"data row52 col0\" >Feature Ratio</td>\n",
       "                        <td id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1arow52_col1\" class=\"data row52 col1\" >False</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1alevel0_row53\" class=\"row_heading level0 row53\" >53</th>\n",
       "                        <td id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1arow53_col0\" class=\"data row53 col0\" >Interaction Threshold</td>\n",
       "                        <td id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1arow53_col1\" class=\"data row53 col1\" >None</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1alevel0_row54\" class=\"row_heading level0 row54\" >54</th>\n",
       "                        <td id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1arow54_col0\" class=\"data row54 col0\" >Transform Target</td>\n",
       "                        <td id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1arow54_col1\" class=\"data row54 col1\" >False</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1alevel0_row55\" class=\"row_heading level0 row55\" >55</th>\n",
       "                        <td id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1arow55_col0\" class=\"data row55 col0\" >Transform Target Method</td>\n",
       "                        <td id=\"T_6611ec1c_682f_11eb_9e2c_b42e99813c1arow55_col1\" class=\"data row55 col1\" >box-cox</td>\n",
       "            </tr>\n",
       "    </tbody></table>"
      ],
      "text/plain": [
       "<pandas.io.formats.style.Styler at 0x7f22ff1f1af0>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "exp_clf = setup(data = df, target = 'target',  session_id=123, \n",
    "                numeric_features=cont_col, \n",
    "                categorical_features=cat_col,\n",
    "                transformation=True,\n",
    "               ignore_features=[\"id\"])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [],
   "source": [
    "# best_model = compare_models(include=[\"br\", \"lr\", \"ridge\", \"catboost\"])\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<style  type=\"text/css\" >\n",
       "    #T_6cabbf59_682f_11eb_9e2c_b42e99813c1a th {\n",
       "          text-align: left;\n",
       "    }#T_6cabbf59_682f_11eb_9e2c_b42e99813c1arow0_col0,#T_6cabbf59_682f_11eb_9e2c_b42e99813c1arow1_col0,#T_6cabbf59_682f_11eb_9e2c_b42e99813c1arow1_col2,#T_6cabbf59_682f_11eb_9e2c_b42e99813c1arow1_col3,#T_6cabbf59_682f_11eb_9e2c_b42e99813c1arow1_col4,#T_6cabbf59_682f_11eb_9e2c_b42e99813c1arow2_col0,#T_6cabbf59_682f_11eb_9e2c_b42e99813c1arow2_col2,#T_6cabbf59_682f_11eb_9e2c_b42e99813c1arow2_col3,#T_6cabbf59_682f_11eb_9e2c_b42e99813c1arow2_col4{\n",
       "            text-align:  left;\n",
       "            text-align:  left;\n",
       "        }#T_6cabbf59_682f_11eb_9e2c_b42e99813c1arow0_col1,#T_6cabbf59_682f_11eb_9e2c_b42e99813c1arow0_col2,#T_6cabbf59_682f_11eb_9e2c_b42e99813c1arow0_col3,#T_6cabbf59_682f_11eb_9e2c_b42e99813c1arow0_col4,#T_6cabbf59_682f_11eb_9e2c_b42e99813c1arow0_col5,#T_6cabbf59_682f_11eb_9e2c_b42e99813c1arow0_col6,#T_6cabbf59_682f_11eb_9e2c_b42e99813c1arow1_col1,#T_6cabbf59_682f_11eb_9e2c_b42e99813c1arow1_col5,#T_6cabbf59_682f_11eb_9e2c_b42e99813c1arow1_col6,#T_6cabbf59_682f_11eb_9e2c_b42e99813c1arow2_col1,#T_6cabbf59_682f_11eb_9e2c_b42e99813c1arow2_col5,#T_6cabbf59_682f_11eb_9e2c_b42e99813c1arow2_col6{\n",
       "            text-align:  left;\n",
       "            text-align:  left;\n",
       "            background-color:  yellow;\n",
       "        }#T_6cabbf59_682f_11eb_9e2c_b42e99813c1arow0_col7,#T_6cabbf59_682f_11eb_9e2c_b42e99813c1arow2_col7{\n",
       "            text-align:  left;\n",
       "            text-align:  left;\n",
       "            background-color:  lightgrey;\n",
       "        }#T_6cabbf59_682f_11eb_9e2c_b42e99813c1arow1_col7{\n",
       "            text-align:  left;\n",
       "            text-align:  left;\n",
       "            background-color:  yellow;\n",
       "            background-color:  lightgrey;\n",
       "        }</style><table id=\"T_6cabbf59_682f_11eb_9e2c_b42e99813c1a\" ><thead>    <tr>        <th class=\"blank level0\" ></th>        <th class=\"col_heading level0 col0\" >Model</th>        <th class=\"col_heading level0 col1\" >MAE</th>        <th class=\"col_heading level0 col2\" >MSE</th>        <th class=\"col_heading level0 col3\" >RMSE</th>        <th class=\"col_heading level0 col4\" >R2</th>        <th class=\"col_heading level0 col5\" >RMSLE</th>        <th class=\"col_heading level0 col6\" >MAPE</th>        <th class=\"col_heading level0 col7\" >TT (Sec)</th>    </tr></thead><tbody>\n",
       "                <tr>\n",
       "                        <th id=\"T_6cabbf59_682f_11eb_9e2c_b42e99813c1alevel0_row0\" class=\"row_heading level0 row0\" >br</th>\n",
       "                        <td id=\"T_6cabbf59_682f_11eb_9e2c_b42e99813c1arow0_col0\" class=\"data row0 col0\" >Bayesian Ridge</td>\n",
       "                        <td id=\"T_6cabbf59_682f_11eb_9e2c_b42e99813c1arow0_col1\" class=\"data row0 col1\" >0.7185</td>\n",
       "                        <td id=\"T_6cabbf59_682f_11eb_9e2c_b42e99813c1arow0_col2\" class=\"data row0 col2\" >0.7447</td>\n",
       "                        <td id=\"T_6cabbf59_682f_11eb_9e2c_b42e99813c1arow0_col3\" class=\"data row0 col3\" >0.8629</td>\n",
       "                        <td id=\"T_6cabbf59_682f_11eb_9e2c_b42e99813c1arow0_col4\" class=\"data row0 col4\" >0.0535</td>\n",
       "                        <td id=\"T_6cabbf59_682f_11eb_9e2c_b42e99813c1arow0_col5\" class=\"data row0 col5\" >0.1046</td>\n",
       "                        <td id=\"T_6cabbf59_682f_11eb_9e2c_b42e99813c1arow0_col6\" class=\"data row0 col6\" >0.0998</td>\n",
       "                        <td id=\"T_6cabbf59_682f_11eb_9e2c_b42e99813c1arow0_col7\" class=\"data row0 col7\" >0.6640</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_6cabbf59_682f_11eb_9e2c_b42e99813c1alevel0_row1\" class=\"row_heading level0 row1\" >ridge</th>\n",
       "                        <td id=\"T_6cabbf59_682f_11eb_9e2c_b42e99813c1arow1_col0\" class=\"data row1 col0\" >Ridge Regression</td>\n",
       "                        <td id=\"T_6cabbf59_682f_11eb_9e2c_b42e99813c1arow1_col1\" class=\"data row1 col1\" >0.7185</td>\n",
       "                        <td id=\"T_6cabbf59_682f_11eb_9e2c_b42e99813c1arow1_col2\" class=\"data row1 col2\" >0.7448</td>\n",
       "                        <td id=\"T_6cabbf59_682f_11eb_9e2c_b42e99813c1arow1_col3\" class=\"data row1 col3\" >0.8630</td>\n",
       "                        <td id=\"T_6cabbf59_682f_11eb_9e2c_b42e99813c1arow1_col4\" class=\"data row1 col4\" >0.0534</td>\n",
       "                        <td id=\"T_6cabbf59_682f_11eb_9e2c_b42e99813c1arow1_col5\" class=\"data row1 col5\" >0.1046</td>\n",
       "                        <td id=\"T_6cabbf59_682f_11eb_9e2c_b42e99813c1arow1_col6\" class=\"data row1 col6\" >0.0998</td>\n",
       "                        <td id=\"T_6cabbf59_682f_11eb_9e2c_b42e99813c1arow1_col7\" class=\"data row1 col7\" >0.0460</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_6cabbf59_682f_11eb_9e2c_b42e99813c1alevel0_row2\" class=\"row_heading level0 row2\" >lr</th>\n",
       "                        <td id=\"T_6cabbf59_682f_11eb_9e2c_b42e99813c1arow2_col0\" class=\"data row2 col0\" >Linear Regression</td>\n",
       "                        <td id=\"T_6cabbf59_682f_11eb_9e2c_b42e99813c1arow2_col1\" class=\"data row2 col1\" >0.7185</td>\n",
       "                        <td id=\"T_6cabbf59_682f_11eb_9e2c_b42e99813c1arow2_col2\" class=\"data row2 col2\" >0.7448</td>\n",
       "                        <td id=\"T_6cabbf59_682f_11eb_9e2c_b42e99813c1arow2_col3\" class=\"data row2 col3\" >0.8630</td>\n",
       "                        <td id=\"T_6cabbf59_682f_11eb_9e2c_b42e99813c1arow2_col4\" class=\"data row2 col4\" >0.0533</td>\n",
       "                        <td id=\"T_6cabbf59_682f_11eb_9e2c_b42e99813c1arow2_col5\" class=\"data row2 col5\" >0.1046</td>\n",
       "                        <td id=\"T_6cabbf59_682f_11eb_9e2c_b42e99813c1arow2_col6\" class=\"data row2 col6\" >0.0998</td>\n",
       "                        <td id=\"T_6cabbf59_682f_11eb_9e2c_b42e99813c1arow2_col7\" class=\"data row2 col7\" >0.1280</td>\n",
       "            </tr>\n",
       "    </tbody></table>"
      ],
      "text/plain": [
       "<pandas.io.formats.style.Styler at 0x7f2328ba6be0>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "best_model = compare_models(include=[\"br\", \"lr\", \"ridge\"])\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<style  type=\"text/css\" >\n",
       "#T_80cd3e3a_682f_11eb_9e2c_b42e99813c1arow10_col0,#T_80cd3e3a_682f_11eb_9e2c_b42e99813c1arow10_col1,#T_80cd3e3a_682f_11eb_9e2c_b42e99813c1arow10_col2,#T_80cd3e3a_682f_11eb_9e2c_b42e99813c1arow10_col3,#T_80cd3e3a_682f_11eb_9e2c_b42e99813c1arow10_col4,#T_80cd3e3a_682f_11eb_9e2c_b42e99813c1arow10_col5{\n",
       "            background:  yellow;\n",
       "        }</style><table id=\"T_80cd3e3a_682f_11eb_9e2c_b42e99813c1a\" ><thead>    <tr>        <th class=\"blank level0\" ></th>        <th class=\"col_heading level0 col0\" >MAE</th>        <th class=\"col_heading level0 col1\" >MSE</th>        <th class=\"col_heading level0 col2\" >RMSE</th>        <th class=\"col_heading level0 col3\" >R2</th>        <th class=\"col_heading level0 col4\" >RMSLE</th>        <th class=\"col_heading level0 col5\" >MAPE</th>    </tr></thead><tbody>\n",
       "                <tr>\n",
       "                        <th id=\"T_80cd3e3a_682f_11eb_9e2c_b42e99813c1alevel0_row0\" class=\"row_heading level0 row0\" >0</th>\n",
       "                        <td id=\"T_80cd3e3a_682f_11eb_9e2c_b42e99813c1arow0_col0\" class=\"data row0 col0\" >0.7180</td>\n",
       "                        <td id=\"T_80cd3e3a_682f_11eb_9e2c_b42e99813c1arow0_col1\" class=\"data row0 col1\" >0.7411</td>\n",
       "                        <td id=\"T_80cd3e3a_682f_11eb_9e2c_b42e99813c1arow0_col2\" class=\"data row0 col2\" >0.8609</td>\n",
       "                        <td id=\"T_80cd3e3a_682f_11eb_9e2c_b42e99813c1arow0_col3\" class=\"data row0 col3\" >0.0541</td>\n",
       "                        <td id=\"T_80cd3e3a_682f_11eb_9e2c_b42e99813c1arow0_col4\" class=\"data row0 col4\" >0.1045</td>\n",
       "                        <td id=\"T_80cd3e3a_682f_11eb_9e2c_b42e99813c1arow0_col5\" class=\"data row0 col5\" >0.0999</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_80cd3e3a_682f_11eb_9e2c_b42e99813c1alevel0_row1\" class=\"row_heading level0 row1\" >1</th>\n",
       "                        <td id=\"T_80cd3e3a_682f_11eb_9e2c_b42e99813c1arow1_col0\" class=\"data row1 col0\" >0.7199</td>\n",
       "                        <td id=\"T_80cd3e3a_682f_11eb_9e2c_b42e99813c1arow1_col1\" class=\"data row1 col1\" >0.7474</td>\n",
       "                        <td id=\"T_80cd3e3a_682f_11eb_9e2c_b42e99813c1arow1_col2\" class=\"data row1 col2\" >0.8645</td>\n",
       "                        <td id=\"T_80cd3e3a_682f_11eb_9e2c_b42e99813c1arow1_col3\" class=\"data row1 col3\" >0.0554</td>\n",
       "                        <td id=\"T_80cd3e3a_682f_11eb_9e2c_b42e99813c1arow1_col4\" class=\"data row1 col4\" >0.1048</td>\n",
       "                        <td id=\"T_80cd3e3a_682f_11eb_9e2c_b42e99813c1arow1_col5\" class=\"data row1 col5\" >0.1001</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_80cd3e3a_682f_11eb_9e2c_b42e99813c1alevel0_row2\" class=\"row_heading level0 row2\" >2</th>\n",
       "                        <td id=\"T_80cd3e3a_682f_11eb_9e2c_b42e99813c1arow2_col0\" class=\"data row2 col0\" >0.7184</td>\n",
       "                        <td id=\"T_80cd3e3a_682f_11eb_9e2c_b42e99813c1arow2_col1\" class=\"data row2 col1\" >0.7433</td>\n",
       "                        <td id=\"T_80cd3e3a_682f_11eb_9e2c_b42e99813c1arow2_col2\" class=\"data row2 col2\" >0.8621</td>\n",
       "                        <td id=\"T_80cd3e3a_682f_11eb_9e2c_b42e99813c1arow2_col3\" class=\"data row2 col3\" >0.0515</td>\n",
       "                        <td id=\"T_80cd3e3a_682f_11eb_9e2c_b42e99813c1arow2_col4\" class=\"data row2 col4\" >0.1044</td>\n",
       "                        <td id=\"T_80cd3e3a_682f_11eb_9e2c_b42e99813c1arow2_col5\" class=\"data row2 col5\" >0.0997</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_80cd3e3a_682f_11eb_9e2c_b42e99813c1alevel0_row3\" class=\"row_heading level0 row3\" >3</th>\n",
       "                        <td id=\"T_80cd3e3a_682f_11eb_9e2c_b42e99813c1arow3_col0\" class=\"data row3 col0\" >0.7135</td>\n",
       "                        <td id=\"T_80cd3e3a_682f_11eb_9e2c_b42e99813c1arow3_col1\" class=\"data row3 col1\" >0.7368</td>\n",
       "                        <td id=\"T_80cd3e3a_682f_11eb_9e2c_b42e99813c1arow3_col2\" class=\"data row3 col2\" >0.8584</td>\n",
       "                        <td id=\"T_80cd3e3a_682f_11eb_9e2c_b42e99813c1arow3_col3\" class=\"data row3 col3\" >0.0530</td>\n",
       "                        <td id=\"T_80cd3e3a_682f_11eb_9e2c_b42e99813c1arow3_col4\" class=\"data row3 col4\" >0.1039</td>\n",
       "                        <td id=\"T_80cd3e3a_682f_11eb_9e2c_b42e99813c1arow3_col5\" class=\"data row3 col5\" >0.0990</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_80cd3e3a_682f_11eb_9e2c_b42e99813c1alevel0_row4\" class=\"row_heading level0 row4\" >4</th>\n",
       "                        <td id=\"T_80cd3e3a_682f_11eb_9e2c_b42e99813c1arow4_col0\" class=\"data row4 col0\" >0.7143</td>\n",
       "                        <td id=\"T_80cd3e3a_682f_11eb_9e2c_b42e99813c1arow4_col1\" class=\"data row4 col1\" >0.7373</td>\n",
       "                        <td id=\"T_80cd3e3a_682f_11eb_9e2c_b42e99813c1arow4_col2\" class=\"data row4 col2\" >0.8586</td>\n",
       "                        <td id=\"T_80cd3e3a_682f_11eb_9e2c_b42e99813c1arow4_col3\" class=\"data row4 col3\" >0.0515</td>\n",
       "                        <td id=\"T_80cd3e3a_682f_11eb_9e2c_b42e99813c1arow4_col4\" class=\"data row4 col4\" >0.1040</td>\n",
       "                        <td id=\"T_80cd3e3a_682f_11eb_9e2c_b42e99813c1arow4_col5\" class=\"data row4 col5\" >0.0992</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_80cd3e3a_682f_11eb_9e2c_b42e99813c1alevel0_row5\" class=\"row_heading level0 row5\" >5</th>\n",
       "                        <td id=\"T_80cd3e3a_682f_11eb_9e2c_b42e99813c1arow5_col0\" class=\"data row5 col0\" >0.7212</td>\n",
       "                        <td id=\"T_80cd3e3a_682f_11eb_9e2c_b42e99813c1arow5_col1\" class=\"data row5 col1\" >0.7480</td>\n",
       "                        <td id=\"T_80cd3e3a_682f_11eb_9e2c_b42e99813c1arow5_col2\" class=\"data row5 col2\" >0.8649</td>\n",
       "                        <td id=\"T_80cd3e3a_682f_11eb_9e2c_b42e99813c1arow5_col3\" class=\"data row5 col3\" >0.0519</td>\n",
       "                        <td id=\"T_80cd3e3a_682f_11eb_9e2c_b42e99813c1arow5_col4\" class=\"data row5 col4\" >0.1047</td>\n",
       "                        <td id=\"T_80cd3e3a_682f_11eb_9e2c_b42e99813c1arow5_col5\" class=\"data row5 col5\" >0.1001</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_80cd3e3a_682f_11eb_9e2c_b42e99813c1alevel0_row6\" class=\"row_heading level0 row6\" >6</th>\n",
       "                        <td id=\"T_80cd3e3a_682f_11eb_9e2c_b42e99813c1arow6_col0\" class=\"data row6 col0\" >0.7153</td>\n",
       "                        <td id=\"T_80cd3e3a_682f_11eb_9e2c_b42e99813c1arow6_col1\" class=\"data row6 col1\" >0.7400</td>\n",
       "                        <td id=\"T_80cd3e3a_682f_11eb_9e2c_b42e99813c1arow6_col2\" class=\"data row6 col2\" >0.8602</td>\n",
       "                        <td id=\"T_80cd3e3a_682f_11eb_9e2c_b42e99813c1arow6_col3\" class=\"data row6 col3\" >0.0545</td>\n",
       "                        <td id=\"T_80cd3e3a_682f_11eb_9e2c_b42e99813c1arow6_col4\" class=\"data row6 col4\" >0.1042</td>\n",
       "                        <td id=\"T_80cd3e3a_682f_11eb_9e2c_b42e99813c1arow6_col5\" class=\"data row6 col5\" >0.0991</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_80cd3e3a_682f_11eb_9e2c_b42e99813c1alevel0_row7\" class=\"row_heading level0 row7\" >7</th>\n",
       "                        <td id=\"T_80cd3e3a_682f_11eb_9e2c_b42e99813c1arow7_col0\" class=\"data row7 col0\" >0.7265</td>\n",
       "                        <td id=\"T_80cd3e3a_682f_11eb_9e2c_b42e99813c1arow7_col1\" class=\"data row7 col1\" >0.7601</td>\n",
       "                        <td id=\"T_80cd3e3a_682f_11eb_9e2c_b42e99813c1arow7_col2\" class=\"data row7 col2\" >0.8718</td>\n",
       "                        <td id=\"T_80cd3e3a_682f_11eb_9e2c_b42e99813c1arow7_col3\" class=\"data row7 col3\" >0.0538</td>\n",
       "                        <td id=\"T_80cd3e3a_682f_11eb_9e2c_b42e99813c1arow7_col4\" class=\"data row7 col4\" >0.1058</td>\n",
       "                        <td id=\"T_80cd3e3a_682f_11eb_9e2c_b42e99813c1arow7_col5\" class=\"data row7 col5\" >0.1010</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_80cd3e3a_682f_11eb_9e2c_b42e99813c1alevel0_row8\" class=\"row_heading level0 row8\" >8</th>\n",
       "                        <td id=\"T_80cd3e3a_682f_11eb_9e2c_b42e99813c1arow8_col0\" class=\"data row8 col0\" >0.7212</td>\n",
       "                        <td id=\"T_80cd3e3a_682f_11eb_9e2c_b42e99813c1arow8_col1\" class=\"data row8 col1\" >0.7530</td>\n",
       "                        <td id=\"T_80cd3e3a_682f_11eb_9e2c_b42e99813c1arow8_col2\" class=\"data row8 col2\" >0.8677</td>\n",
       "                        <td id=\"T_80cd3e3a_682f_11eb_9e2c_b42e99813c1arow8_col3\" class=\"data row8 col3\" >0.0503</td>\n",
       "                        <td id=\"T_80cd3e3a_682f_11eb_9e2c_b42e99813c1arow8_col4\" class=\"data row8 col4\" >0.1051</td>\n",
       "                        <td id=\"T_80cd3e3a_682f_11eb_9e2c_b42e99813c1arow8_col5\" class=\"data row8 col5\" >0.1000</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_80cd3e3a_682f_11eb_9e2c_b42e99813c1alevel0_row9\" class=\"row_heading level0 row9\" >9</th>\n",
       "                        <td id=\"T_80cd3e3a_682f_11eb_9e2c_b42e99813c1arow9_col0\" class=\"data row9 col0\" >0.7166</td>\n",
       "                        <td id=\"T_80cd3e3a_682f_11eb_9e2c_b42e99813c1arow9_col1\" class=\"data row9 col1\" >0.7410</td>\n",
       "                        <td id=\"T_80cd3e3a_682f_11eb_9e2c_b42e99813c1arow9_col2\" class=\"data row9 col2\" >0.8608</td>\n",
       "                        <td id=\"T_80cd3e3a_682f_11eb_9e2c_b42e99813c1arow9_col3\" class=\"data row9 col3\" >0.0574</td>\n",
       "                        <td id=\"T_80cd3e3a_682f_11eb_9e2c_b42e99813c1arow9_col4\" class=\"data row9 col4\" >0.1045</td>\n",
       "                        <td id=\"T_80cd3e3a_682f_11eb_9e2c_b42e99813c1arow9_col5\" class=\"data row9 col5\" >0.0996</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_80cd3e3a_682f_11eb_9e2c_b42e99813c1alevel0_row10\" class=\"row_heading level0 row10\" >Mean</th>\n",
       "                        <td id=\"T_80cd3e3a_682f_11eb_9e2c_b42e99813c1arow10_col0\" class=\"data row10 col0\" >0.7185</td>\n",
       "                        <td id=\"T_80cd3e3a_682f_11eb_9e2c_b42e99813c1arow10_col1\" class=\"data row10 col1\" >0.7448</td>\n",
       "                        <td id=\"T_80cd3e3a_682f_11eb_9e2c_b42e99813c1arow10_col2\" class=\"data row10 col2\" >0.8630</td>\n",
       "                        <td id=\"T_80cd3e3a_682f_11eb_9e2c_b42e99813c1arow10_col3\" class=\"data row10 col3\" >0.0533</td>\n",
       "                        <td id=\"T_80cd3e3a_682f_11eb_9e2c_b42e99813c1arow10_col4\" class=\"data row10 col4\" >0.1046</td>\n",
       "                        <td id=\"T_80cd3e3a_682f_11eb_9e2c_b42e99813c1arow10_col5\" class=\"data row10 col5\" >0.0998</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_80cd3e3a_682f_11eb_9e2c_b42e99813c1alevel0_row11\" class=\"row_heading level0 row11\" >SD</th>\n",
       "                        <td id=\"T_80cd3e3a_682f_11eb_9e2c_b42e99813c1arow11_col0\" class=\"data row11 col0\" >0.0037</td>\n",
       "                        <td id=\"T_80cd3e3a_682f_11eb_9e2c_b42e99813c1arow11_col1\" class=\"data row11 col1\" >0.0070</td>\n",
       "                        <td id=\"T_80cd3e3a_682f_11eb_9e2c_b42e99813c1arow11_col2\" class=\"data row11 col2\" >0.0040</td>\n",
       "                        <td id=\"T_80cd3e3a_682f_11eb_9e2c_b42e99813c1arow11_col3\" class=\"data row11 col3\" >0.0020</td>\n",
       "                        <td id=\"T_80cd3e3a_682f_11eb_9e2c_b42e99813c1arow11_col4\" class=\"data row11 col4\" >0.0005</td>\n",
       "                        <td id=\"T_80cd3e3a_682f_11eb_9e2c_b42e99813c1arow11_col5\" class=\"data row11 col5\" >0.0006</td>\n",
       "            </tr>\n",
       "    </tbody></table>"
      ],
      "text/plain": [
       "<pandas.io.formats.style.Styler at 0x7f2301ffe970>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "model = create_model('lr')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [],
   "source": [
    "# ?create_model"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "\u001b[0;31mSignature:\u001b[0m\n",
       "\u001b[0mensemble_model\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m\u001b[0m\n",
       "\u001b[0;34m\u001b[0m    \u001b[0mestimator\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n",
       "\u001b[0;34m\u001b[0m    \u001b[0mmethod\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mstr\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;34m'Bagging'\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n",
       "\u001b[0;34m\u001b[0m    \u001b[0mfold\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mUnion\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mint\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mAny\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mNoneType\u001b[0m\u001b[0;34m]\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n",
       "\u001b[0;34m\u001b[0m    \u001b[0mn_estimators\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mint\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;36m10\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n",
       "\u001b[0;34m\u001b[0m    \u001b[0mround\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mint\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;36m4\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n",
       "\u001b[0;34m\u001b[0m    \u001b[0mchoose_better\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mbool\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;32mFalse\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n",
       "\u001b[0;34m\u001b[0m    \u001b[0moptimize\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mstr\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;34m'R2'\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n",
       "\u001b[0;34m\u001b[0m    \u001b[0mfit_kwargs\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mUnion\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mdict\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mNoneType\u001b[0m\u001b[0;34m]\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n",
       "\u001b[0;34m\u001b[0m    \u001b[0mgroups\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mUnion\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mstr\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mAny\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mNoneType\u001b[0m\u001b[0;34m]\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n",
       "\u001b[0;34m\u001b[0m    \u001b[0mverbose\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mbool\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;32mTrue\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n",
       "\u001b[0;34m\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;34m->\u001b[0m \u001b[0mAny\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
       "\u001b[0;31mDocstring:\u001b[0m\n",
       " This function ensembles a given estimator. The output of this function is \n",
       " a score grid with CV scores by fold. Metrics evaluated during CV can be \n",
       " accessed using the ``get_metrics`` function. Custom metrics can be added\n",
       " or removed using ``add_metric`` and ``remove_metric`` function. \n",
       "\n",
       "\n",
       " Example\n",
       " --------\n",
       " >>> from pycaret.datasets import get_data\n",
       " >>> boston = get_data('boston')\n",
       " >>> from pycaret.regression import *\n",
       " >>> exp_name = setup(data = boston,  target = 'medv')\n",
       " >>> dt = create_model('dt')\n",
       " >>> bagged_dt = ensemble_model(dt, method = 'Bagging')\n",
       "\n",
       "\n",
       "estimator: scikit-learn compatible object\n",
       "     Trained model object\n",
       "\n",
       "\n",
       " method: str, default = 'Bagging'\n",
       "     Method for ensembling base estimator. It can be 'Bagging' or 'Boosting'. \n",
       "\n",
       "\n",
       " fold: int or scikit-learn compatible CV generator, default = None\n",
       "     Controls cross-validation. If None, the CV generator in the ``fold_strategy`` \n",
       "     parameter of the ``setup`` function is used. When an integer is passed, \n",
       "     it is interpreted as the 'n_splits' parameter of the CV generator in the \n",
       "     ``setup`` function.\n",
       "     \n",
       "\n",
       " n_estimators: int, default = 10\n",
       "     The number of base estimators in the ensemble. In case of perfect fit, the \n",
       "     learning procedure is stopped early.\n",
       "\n",
       "     \n",
       " round: int, default = 4\n",
       "     Number of decimal places the metrics in the score grid will be rounded to. \n",
       "\n",
       "\n",
       " choose_better: bool, default = False\n",
       "     When set to True, the returned object is always better performing. The\n",
       "     metric used for comparison is defined by the ``optimize`` parameter. \n",
       "\n",
       "\n",
       " optimize: str, default = 'R2'\n",
       "     Metric to compare for model selection when ``choose_better`` is True.\n",
       "\n",
       "\n",
       " fit_kwargs: dict, default = {} (empty dict)\n",
       "     Dictionary of arguments passed to the fit method of the model.\n",
       "\n",
       "\n",
       " groups: str or array-like, with shape (n_samples,), default = None\n",
       "     Optional group labels when GroupKFold is used for the cross validation.\n",
       "     It takes an array with shape (n_samples, ) where n_samples is the number\n",
       "     of rows in training dataset. When string is passed, it is interpreted as \n",
       "     the column name in the dataset containing group labels.\n",
       "\n",
       "\n",
       " verbose: bool, default = True\n",
       "     Score grid is not printed when verbose is set to False.\n",
       "\n",
       "\n",
       " Returns:\n",
       "     Trained Model\n",
       "   \n",
       " \n",
       "\u001b[0;31mFile:\u001b[0m      ~/miniconda3/envs/caret/lib/python3.8/site-packages/pycaret/regression.py\n",
       "\u001b[0;31mType:\u001b[0m      function\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "?ensemble_model"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<style  type=\"text/css\" >\n",
       "#T_e0f2a6ba_682f_11eb_9e2c_b42e99813c1arow10_col0,#T_e0f2a6ba_682f_11eb_9e2c_b42e99813c1arow10_col1,#T_e0f2a6ba_682f_11eb_9e2c_b42e99813c1arow10_col2,#T_e0f2a6ba_682f_11eb_9e2c_b42e99813c1arow10_col3,#T_e0f2a6ba_682f_11eb_9e2c_b42e99813c1arow10_col4,#T_e0f2a6ba_682f_11eb_9e2c_b42e99813c1arow10_col5{\n",
       "            background:  yellow;\n",
       "        }</style><table id=\"T_e0f2a6ba_682f_11eb_9e2c_b42e99813c1a\" ><thead>    <tr>        <th class=\"blank level0\" ></th>        <th class=\"col_heading level0 col0\" >MAE</th>        <th class=\"col_heading level0 col1\" >MSE</th>        <th class=\"col_heading level0 col2\" >RMSE</th>        <th class=\"col_heading level0 col3\" >R2</th>        <th class=\"col_heading level0 col4\" >RMSLE</th>        <th class=\"col_heading level0 col5\" >MAPE</th>    </tr></thead><tbody>\n",
       "                <tr>\n",
       "                        <th id=\"T_e0f2a6ba_682f_11eb_9e2c_b42e99813c1alevel0_row0\" class=\"row_heading level0 row0\" >0</th>\n",
       "                        <td id=\"T_e0f2a6ba_682f_11eb_9e2c_b42e99813c1arow0_col0\" class=\"data row0 col0\" >0.7318</td>\n",
       "                        <td id=\"T_e0f2a6ba_682f_11eb_9e2c_b42e99813c1arow0_col1\" class=\"data row0 col1\" >0.7592</td>\n",
       "                        <td id=\"T_e0f2a6ba_682f_11eb_9e2c_b42e99813c1arow0_col2\" class=\"data row0 col2\" >0.8713</td>\n",
       "                        <td id=\"T_e0f2a6ba_682f_11eb_9e2c_b42e99813c1arow0_col3\" class=\"data row0 col3\" >0.0309</td>\n",
       "                        <td id=\"T_e0f2a6ba_682f_11eb_9e2c_b42e99813c1arow0_col4\" class=\"data row0 col4\" >0.1050</td>\n",
       "                        <td id=\"T_e0f2a6ba_682f_11eb_9e2c_b42e99813c1arow0_col5\" class=\"data row0 col5\" >0.1003</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_e0f2a6ba_682f_11eb_9e2c_b42e99813c1alevel0_row1\" class=\"row_heading level0 row1\" >1</th>\n",
       "                        <td id=\"T_e0f2a6ba_682f_11eb_9e2c_b42e99813c1arow1_col0\" class=\"data row1 col0\" >0.7360</td>\n",
       "                        <td id=\"T_e0f2a6ba_682f_11eb_9e2c_b42e99813c1arow1_col1\" class=\"data row1 col1\" >0.7701</td>\n",
       "                        <td id=\"T_e0f2a6ba_682f_11eb_9e2c_b42e99813c1arow1_col2\" class=\"data row1 col2\" >0.8776</td>\n",
       "                        <td id=\"T_e0f2a6ba_682f_11eb_9e2c_b42e99813c1arow1_col3\" class=\"data row1 col3\" >0.0267</td>\n",
       "                        <td id=\"T_e0f2a6ba_682f_11eb_9e2c_b42e99813c1arow1_col4\" class=\"data row1 col4\" >0.1056</td>\n",
       "                        <td id=\"T_e0f2a6ba_682f_11eb_9e2c_b42e99813c1arow1_col5\" class=\"data row1 col5\" >0.1007</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_e0f2a6ba_682f_11eb_9e2c_b42e99813c1alevel0_row2\" class=\"row_heading level0 row2\" >2</th>\n",
       "                        <td id=\"T_e0f2a6ba_682f_11eb_9e2c_b42e99813c1arow2_col0\" class=\"data row2 col0\" >0.7315</td>\n",
       "                        <td id=\"T_e0f2a6ba_682f_11eb_9e2c_b42e99813c1arow2_col1\" class=\"data row2 col1\" >0.7593</td>\n",
       "                        <td id=\"T_e0f2a6ba_682f_11eb_9e2c_b42e99813c1arow2_col2\" class=\"data row2 col2\" >0.8714</td>\n",
       "                        <td id=\"T_e0f2a6ba_682f_11eb_9e2c_b42e99813c1arow2_col3\" class=\"data row2 col3\" >0.0310</td>\n",
       "                        <td id=\"T_e0f2a6ba_682f_11eb_9e2c_b42e99813c1arow2_col4\" class=\"data row2 col4\" >0.1049</td>\n",
       "                        <td id=\"T_e0f2a6ba_682f_11eb_9e2c_b42e99813c1arow2_col5\" class=\"data row2 col5\" >0.1002</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_e0f2a6ba_682f_11eb_9e2c_b42e99813c1alevel0_row3\" class=\"row_heading level0 row3\" >3</th>\n",
       "                        <td id=\"T_e0f2a6ba_682f_11eb_9e2c_b42e99813c1arow3_col0\" class=\"data row3 col0\" >0.7327</td>\n",
       "                        <td id=\"T_e0f2a6ba_682f_11eb_9e2c_b42e99813c1arow3_col1\" class=\"data row3 col1\" >0.7672</td>\n",
       "                        <td id=\"T_e0f2a6ba_682f_11eb_9e2c_b42e99813c1arow3_col2\" class=\"data row3 col2\" >0.8759</td>\n",
       "                        <td id=\"T_e0f2a6ba_682f_11eb_9e2c_b42e99813c1arow3_col3\" class=\"data row3 col3\" >0.0139</td>\n",
       "                        <td id=\"T_e0f2a6ba_682f_11eb_9e2c_b42e99813c1arow3_col4\" class=\"data row3 col4\" >0.1051</td>\n",
       "                        <td id=\"T_e0f2a6ba_682f_11eb_9e2c_b42e99813c1arow3_col5\" class=\"data row3 col5\" >0.0997</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_e0f2a6ba_682f_11eb_9e2c_b42e99813c1alevel0_row4\" class=\"row_heading level0 row4\" >4</th>\n",
       "                        <td id=\"T_e0f2a6ba_682f_11eb_9e2c_b42e99813c1arow4_col0\" class=\"data row4 col0\" >0.7281</td>\n",
       "                        <td id=\"T_e0f2a6ba_682f_11eb_9e2c_b42e99813c1arow4_col1\" class=\"data row4 col1\" >0.7540</td>\n",
       "                        <td id=\"T_e0f2a6ba_682f_11eb_9e2c_b42e99813c1arow4_col2\" class=\"data row4 col2\" >0.8683</td>\n",
       "                        <td id=\"T_e0f2a6ba_682f_11eb_9e2c_b42e99813c1arow4_col3\" class=\"data row4 col3\" >0.0300</td>\n",
       "                        <td id=\"T_e0f2a6ba_682f_11eb_9e2c_b42e99813c1arow4_col4\" class=\"data row4 col4\" >0.1046</td>\n",
       "                        <td id=\"T_e0f2a6ba_682f_11eb_9e2c_b42e99813c1arow4_col5\" class=\"data row4 col5\" >0.0998</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_e0f2a6ba_682f_11eb_9e2c_b42e99813c1alevel0_row5\" class=\"row_heading level0 row5\" >5</th>\n",
       "                        <td id=\"T_e0f2a6ba_682f_11eb_9e2c_b42e99813c1arow5_col0\" class=\"data row5 col0\" >0.7624</td>\n",
       "                        <td id=\"T_e0f2a6ba_682f_11eb_9e2c_b42e99813c1arow5_col1\" class=\"data row5 col1\" >0.8344</td>\n",
       "                        <td id=\"T_e0f2a6ba_682f_11eb_9e2c_b42e99813c1arow5_col2\" class=\"data row5 col2\" >0.9134</td>\n",
       "                        <td id=\"T_e0f2a6ba_682f_11eb_9e2c_b42e99813c1arow5_col3\" class=\"data row5 col3\" >-0.0576</td>\n",
       "                        <td id=\"T_e0f2a6ba_682f_11eb_9e2c_b42e99813c1arow5_col4\" class=\"data row5 col4\" >0.1093</td>\n",
       "                        <td id=\"T_e0f2a6ba_682f_11eb_9e2c_b42e99813c1arow5_col5\" class=\"data row5 col5\" >0.1026</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_e0f2a6ba_682f_11eb_9e2c_b42e99813c1alevel0_row6\" class=\"row_heading level0 row6\" >6</th>\n",
       "                        <td id=\"T_e0f2a6ba_682f_11eb_9e2c_b42e99813c1arow6_col0\" class=\"data row6 col0\" >0.7325</td>\n",
       "                        <td id=\"T_e0f2a6ba_682f_11eb_9e2c_b42e99813c1arow6_col1\" class=\"data row6 col1\" >0.7638</td>\n",
       "                        <td id=\"T_e0f2a6ba_682f_11eb_9e2c_b42e99813c1arow6_col2\" class=\"data row6 col2\" >0.8739</td>\n",
       "                        <td id=\"T_e0f2a6ba_682f_11eb_9e2c_b42e99813c1arow6_col3\" class=\"data row6 col3\" >0.0242</td>\n",
       "                        <td id=\"T_e0f2a6ba_682f_11eb_9e2c_b42e99813c1arow6_col4\" class=\"data row6 col4\" >0.1051</td>\n",
       "                        <td id=\"T_e0f2a6ba_682f_11eb_9e2c_b42e99813c1arow6_col5\" class=\"data row6 col5\" >0.0999</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_e0f2a6ba_682f_11eb_9e2c_b42e99813c1alevel0_row7\" class=\"row_heading level0 row7\" >7</th>\n",
       "                        <td id=\"T_e0f2a6ba_682f_11eb_9e2c_b42e99813c1arow7_col0\" class=\"data row7 col0\" >0.7456</td>\n",
       "                        <td id=\"T_e0f2a6ba_682f_11eb_9e2c_b42e99813c1arow7_col1\" class=\"data row7 col1\" >0.7902</td>\n",
       "                        <td id=\"T_e0f2a6ba_682f_11eb_9e2c_b42e99813c1arow7_col2\" class=\"data row7 col2\" >0.8889</td>\n",
       "                        <td id=\"T_e0f2a6ba_682f_11eb_9e2c_b42e99813c1arow7_col3\" class=\"data row7 col3\" >0.0163</td>\n",
       "                        <td id=\"T_e0f2a6ba_682f_11eb_9e2c_b42e99813c1arow7_col4\" class=\"data row7 col4\" >0.1069</td>\n",
       "                        <td id=\"T_e0f2a6ba_682f_11eb_9e2c_b42e99813c1arow7_col5\" class=\"data row7 col5\" >0.1017</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_e0f2a6ba_682f_11eb_9e2c_b42e99813c1alevel0_row8\" class=\"row_heading level0 row8\" >8</th>\n",
       "                        <td id=\"T_e0f2a6ba_682f_11eb_9e2c_b42e99813c1arow8_col0\" class=\"data row8 col0\" >0.7312</td>\n",
       "                        <td id=\"T_e0f2a6ba_682f_11eb_9e2c_b42e99813c1arow8_col1\" class=\"data row8 col1\" >0.7629</td>\n",
       "                        <td id=\"T_e0f2a6ba_682f_11eb_9e2c_b42e99813c1arow8_col2\" class=\"data row8 col2\" >0.8735</td>\n",
       "                        <td id=\"T_e0f2a6ba_682f_11eb_9e2c_b42e99813c1arow8_col3\" class=\"data row8 col3\" >0.0377</td>\n",
       "                        <td id=\"T_e0f2a6ba_682f_11eb_9e2c_b42e99813c1arow8_col4\" class=\"data row8 col4\" >0.1053</td>\n",
       "                        <td id=\"T_e0f2a6ba_682f_11eb_9e2c_b42e99813c1arow8_col5\" class=\"data row8 col5\" >0.1004</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_e0f2a6ba_682f_11eb_9e2c_b42e99813c1alevel0_row9\" class=\"row_heading level0 row9\" >9</th>\n",
       "                        <td id=\"T_e0f2a6ba_682f_11eb_9e2c_b42e99813c1arow9_col0\" class=\"data row9 col0\" >0.7235</td>\n",
       "                        <td id=\"T_e0f2a6ba_682f_11eb_9e2c_b42e99813c1arow9_col1\" class=\"data row9 col1\" >0.7465</td>\n",
       "                        <td id=\"T_e0f2a6ba_682f_11eb_9e2c_b42e99813c1arow9_col2\" class=\"data row9 col2\" >0.8640</td>\n",
       "                        <td id=\"T_e0f2a6ba_682f_11eb_9e2c_b42e99813c1arow9_col3\" class=\"data row9 col3\" >0.0505</td>\n",
       "                        <td id=\"T_e0f2a6ba_682f_11eb_9e2c_b42e99813c1arow9_col4\" class=\"data row9 col4\" >0.1045</td>\n",
       "                        <td id=\"T_e0f2a6ba_682f_11eb_9e2c_b42e99813c1arow9_col5\" class=\"data row9 col5\" >0.0999</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_e0f2a6ba_682f_11eb_9e2c_b42e99813c1alevel0_row10\" class=\"row_heading level0 row10\" >Mean</th>\n",
       "                        <td id=\"T_e0f2a6ba_682f_11eb_9e2c_b42e99813c1arow10_col0\" class=\"data row10 col0\" >0.7355</td>\n",
       "                        <td id=\"T_e0f2a6ba_682f_11eb_9e2c_b42e99813c1arow10_col1\" class=\"data row10 col1\" >0.7708</td>\n",
       "                        <td id=\"T_e0f2a6ba_682f_11eb_9e2c_b42e99813c1arow10_col2\" class=\"data row10 col2\" >0.8778</td>\n",
       "                        <td id=\"T_e0f2a6ba_682f_11eb_9e2c_b42e99813c1arow10_col3\" class=\"data row10 col3\" >0.0204</td>\n",
       "                        <td id=\"T_e0f2a6ba_682f_11eb_9e2c_b42e99813c1arow10_col4\" class=\"data row10 col4\" >0.1056</td>\n",
       "                        <td id=\"T_e0f2a6ba_682f_11eb_9e2c_b42e99813c1arow10_col5\" class=\"data row10 col5\" >0.1005</td>\n",
       "            </tr>\n",
       "            <tr>\n",
       "                        <th id=\"T_e0f2a6ba_682f_11eb_9e2c_b42e99813c1alevel0_row11\" class=\"row_heading level0 row11\" >SD</th>\n",
       "                        <td id=\"T_e0f2a6ba_682f_11eb_9e2c_b42e99813c1arow11_col0\" class=\"data row11 col0\" >0.0104</td>\n",
       "                        <td id=\"T_e0f2a6ba_682f_11eb_9e2c_b42e99813c1arow11_col1\" class=\"data row11 col1\" >0.0238</td>\n",
       "                        <td id=\"T_e0f2a6ba_682f_11eb_9e2c_b42e99813c1arow11_col2\" class=\"data row11 col2\" >0.0134</td>\n",
       "                        <td id=\"T_e0f2a6ba_682f_11eb_9e2c_b42e99813c1arow11_col3\" class=\"data row11 col3\" >0.0278</td>\n",
       "                        <td id=\"T_e0f2a6ba_682f_11eb_9e2c_b42e99813c1arow11_col4\" class=\"data row11 col4\" >0.0014</td>\n",
       "                        <td id=\"T_e0f2a6ba_682f_11eb_9e2c_b42e99813c1arow11_col5\" class=\"data row11 col5\" >0.0009</td>\n",
       "            </tr>\n",
       "    </tbody></table>"
      ],
      "text/plain": [
       "<pandas.io.formats.style.Styler at 0x7f23022b0a30>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "boosted_model = ensemble_model(model, method = 'Boosting', n_estimators = 100, optimize = 'RMSE')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [],
   "source": [
    "# tuned_model = tune_model(boosted_model, optimize = 'RMSE')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [],
   "source": [
    "# finalize a model\n",
    "final_model = finalize_model(boosted_model)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Transformation Pipeline and Model Succesfully Saved\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "(Pipeline(memory=None,\n",
       "          steps=[('dtypes',\n",
       "                  DataTypes_Auto_infer(categorical_features=['cat0', 'cat1',\n",
       "                                                             'cat2', 'cat3',\n",
       "                                                             'cat4', 'cat5',\n",
       "                                                             'cat6', 'cat7',\n",
       "                                                             'cat8', 'cat9'],\n",
       "                                       display_types=True,\n",
       "                                       features_todrop=['id'], id_columns=[],\n",
       "                                       ml_usecase='regression',\n",
       "                                       numerical_features=['cont0', 'cont1',\n",
       "                                                           'cont2', 'cont3',\n",
       "                                                           'cont4', 'cont5',\n",
       "                                                           'cont6', 'cont7',\n",
       "                                                           'cont8', 'cont9',\n",
       "                                                           'cont10', 'cont11',...\n",
       "                 ('fix_perfect', Remove_100(target='target')),\n",
       "                 ('clean_names', Clean_Colum_Names()),\n",
       "                 ('feature_select', 'passthrough'), ('fix_multi', 'passthrough'),\n",
       "                 ('dfs', 'passthrough'), ('pca', 'passthrough'),\n",
       "                 ['trained_model',\n",
       "                  AdaBoostRegressor(base_estimator=LinearRegression(copy_X=True,\n",
       "                                                                    fit_intercept=True,\n",
       "                                                                    n_jobs=-1,\n",
       "                                                                    normalize=False),\n",
       "                                    learning_rate=1.0, loss='linear',\n",
       "                                    n_estimators=100, random_state=123)]],\n",
       "          verbose=False),\n",
       " 'v3_model.pkl')"
      ]
     },
     "execution_count": 20,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# save a model\n",
    "save_model(final_model, 'v3_model')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Make prediction on test data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>id</th>\n",
       "      <th>cat0</th>\n",
       "      <th>cat1</th>\n",
       "      <th>cat2</th>\n",
       "      <th>cat3</th>\n",
       "      <th>cat4</th>\n",
       "      <th>cat5</th>\n",
       "      <th>cat6</th>\n",
       "      <th>cat7</th>\n",
       "      <th>cat8</th>\n",
       "      <th>...</th>\n",
       "      <th>cont4</th>\n",
       "      <th>cont5</th>\n",
       "      <th>cont6</th>\n",
       "      <th>cont7</th>\n",
       "      <th>cont8</th>\n",
       "      <th>cont9</th>\n",
       "      <th>cont10</th>\n",
       "      <th>cont11</th>\n",
       "      <th>cont12</th>\n",
       "      <th>cont13</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>0</td>\n",
       "      <td>A</td>\n",
       "      <td>B</td>\n",
       "      <td>A</td>\n",
       "      <td>C</td>\n",
       "      <td>B</td>\n",
       "      <td>D</td>\n",
       "      <td>A</td>\n",
       "      <td>E</td>\n",
       "      <td>E</td>\n",
       "      <td>...</td>\n",
       "      <td>0.701679</td>\n",
       "      <td>0.595507</td>\n",
       "      <td>0.286912</td>\n",
       "      <td>0.279884</td>\n",
       "      <td>0.202234</td>\n",
       "      <td>0.242654</td>\n",
       "      <td>0.285147</td>\n",
       "      <td>0.264308</td>\n",
       "      <td>0.653654</td>\n",
       "      <td>0.302448</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>5</td>\n",
       "      <td>A</td>\n",
       "      <td>B</td>\n",
       "      <td>A</td>\n",
       "      <td>C</td>\n",
       "      <td>B</td>\n",
       "      <td>D</td>\n",
       "      <td>A</td>\n",
       "      <td>E</td>\n",
       "      <td>C</td>\n",
       "      <td>...</td>\n",
       "      <td>0.277480</td>\n",
       "      <td>0.479552</td>\n",
       "      <td>0.397436</td>\n",
       "      <td>0.476742</td>\n",
       "      <td>0.857073</td>\n",
       "      <td>0.516393</td>\n",
       "      <td>0.562065</td>\n",
       "      <td>0.730542</td>\n",
       "      <td>0.318492</td>\n",
       "      <td>0.736251</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>15</td>\n",
       "      <td>A</td>\n",
       "      <td>B</td>\n",
       "      <td>A</td>\n",
       "      <td>C</td>\n",
       "      <td>B</td>\n",
       "      <td>D</td>\n",
       "      <td>A</td>\n",
       "      <td>E</td>\n",
       "      <td>C</td>\n",
       "      <td>...</td>\n",
       "      <td>0.279508</td>\n",
       "      <td>0.676395</td>\n",
       "      <td>0.695284</td>\n",
       "      <td>0.253316</td>\n",
       "      <td>0.586934</td>\n",
       "      <td>0.548555</td>\n",
       "      <td>0.836193</td>\n",
       "      <td>0.759788</td>\n",
       "      <td>0.333572</td>\n",
       "      <td>0.273905</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>16</td>\n",
       "      <td>A</td>\n",
       "      <td>A</td>\n",
       "      <td>B</td>\n",
       "      <td>A</td>\n",
       "      <td>B</td>\n",
       "      <td>D</td>\n",
       "      <td>A</td>\n",
       "      <td>E</td>\n",
       "      <td>E</td>\n",
       "      <td>...</td>\n",
       "      <td>0.479503</td>\n",
       "      <td>0.759875</td>\n",
       "      <td>0.240049</td>\n",
       "      <td>0.298074</td>\n",
       "      <td>0.442475</td>\n",
       "      <td>0.596746</td>\n",
       "      <td>0.414131</td>\n",
       "      <td>0.255382</td>\n",
       "      <td>0.589080</td>\n",
       "      <td>0.311625</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>17</td>\n",
       "      <td>A</td>\n",
       "      <td>B</td>\n",
       "      <td>A</td>\n",
       "      <td>A</td>\n",
       "      <td>B</td>\n",
       "      <td>B</td>\n",
       "      <td>A</td>\n",
       "      <td>E</td>\n",
       "      <td>E</td>\n",
       "      <td>...</td>\n",
       "      <td>0.757845</td>\n",
       "      <td>0.210232</td>\n",
       "      <td>0.329851</td>\n",
       "      <td>0.616663</td>\n",
       "      <td>0.170475</td>\n",
       "      <td>0.263235</td>\n",
       "      <td>0.710961</td>\n",
       "      <td>0.224045</td>\n",
       "      <td>0.285860</td>\n",
       "      <td>0.794931</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>5 rows × 25 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "   id cat0 cat1 cat2 cat3 cat4 cat5 cat6 cat7 cat8  ...     cont4     cont5  \\\n",
       "0   0    A    B    A    C    B    D    A    E    E  ...  0.701679  0.595507   \n",
       "1   5    A    B    A    C    B    D    A    E    C  ...  0.277480  0.479552   \n",
       "2  15    A    B    A    C    B    D    A    E    C  ...  0.279508  0.676395   \n",
       "3  16    A    A    B    A    B    D    A    E    E  ...  0.479503  0.759875   \n",
       "4  17    A    B    A    A    B    B    A    E    E  ...  0.757845  0.210232   \n",
       "\n",
       "      cont6     cont7     cont8     cont9    cont10    cont11    cont12  \\\n",
       "0  0.286912  0.279884  0.202234  0.242654  0.285147  0.264308  0.653654   \n",
       "1  0.397436  0.476742  0.857073  0.516393  0.562065  0.730542  0.318492   \n",
       "2  0.695284  0.253316  0.586934  0.548555  0.836193  0.759788  0.333572   \n",
       "3  0.240049  0.298074  0.442475  0.596746  0.414131  0.255382  0.589080   \n",
       "4  0.329851  0.616663  0.170475  0.263235  0.710961  0.224045  0.285860   \n",
       "\n",
       "     cont13  \n",
       "0  0.302448  \n",
       "1  0.736251  \n",
       "2  0.273905  \n",
       "3  0.311625  \n",
       "4  0.794931  \n",
       "\n",
       "[5 rows x 25 columns]"
      ]
     },
     "execution_count": 21,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_test = pd.read_csv(\"../data/test.csv\")\n",
    "df_test.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {},
   "outputs": [],
   "source": [
    "y_pred = predict_model(final_model, df_test)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>cat0</th>\n",
       "      <th>cat1</th>\n",
       "      <th>cat2</th>\n",
       "      <th>cat3</th>\n",
       "      <th>cat4</th>\n",
       "      <th>cat5</th>\n",
       "      <th>cat6</th>\n",
       "      <th>cat7</th>\n",
       "      <th>cat8</th>\n",
       "      <th>cat9</th>\n",
       "      <th>...</th>\n",
       "      <th>cont5</th>\n",
       "      <th>cont6</th>\n",
       "      <th>cont7</th>\n",
       "      <th>cont8</th>\n",
       "      <th>cont9</th>\n",
       "      <th>cont10</th>\n",
       "      <th>cont11</th>\n",
       "      <th>cont12</th>\n",
       "      <th>cont13</th>\n",
       "      <th>Label</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>A</td>\n",
       "      <td>B</td>\n",
       "      <td>A</td>\n",
       "      <td>C</td>\n",
       "      <td>B</td>\n",
       "      <td>D</td>\n",
       "      <td>A</td>\n",
       "      <td>E</td>\n",
       "      <td>E</td>\n",
       "      <td>G</td>\n",
       "      <td>...</td>\n",
       "      <td>0.595507</td>\n",
       "      <td>0.286912</td>\n",
       "      <td>0.279884</td>\n",
       "      <td>0.202234</td>\n",
       "      <td>0.242654</td>\n",
       "      <td>0.285147</td>\n",
       "      <td>0.264308</td>\n",
       "      <td>0.653654</td>\n",
       "      <td>0.302448</td>\n",
       "      <td>7.160156</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>A</td>\n",
       "      <td>B</td>\n",
       "      <td>A</td>\n",
       "      <td>C</td>\n",
       "      <td>B</td>\n",
       "      <td>D</td>\n",
       "      <td>A</td>\n",
       "      <td>E</td>\n",
       "      <td>C</td>\n",
       "      <td>L</td>\n",
       "      <td>...</td>\n",
       "      <td>0.479552</td>\n",
       "      <td>0.397436</td>\n",
       "      <td>0.476742</td>\n",
       "      <td>0.857073</td>\n",
       "      <td>0.516393</td>\n",
       "      <td>0.562065</td>\n",
       "      <td>0.730542</td>\n",
       "      <td>0.318492</td>\n",
       "      <td>0.736251</td>\n",
       "      <td>8.106445</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>A</td>\n",
       "      <td>B</td>\n",
       "      <td>A</td>\n",
       "      <td>C</td>\n",
       "      <td>B</td>\n",
       "      <td>D</td>\n",
       "      <td>A</td>\n",
       "      <td>E</td>\n",
       "      <td>C</td>\n",
       "      <td>F</td>\n",
       "      <td>...</td>\n",
       "      <td>0.676395</td>\n",
       "      <td>0.695284</td>\n",
       "      <td>0.253316</td>\n",
       "      <td>0.586934</td>\n",
       "      <td>0.548555</td>\n",
       "      <td>0.836193</td>\n",
       "      <td>0.759788</td>\n",
       "      <td>0.333572</td>\n",
       "      <td>0.273905</td>\n",
       "      <td>7.132431</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>A</td>\n",
       "      <td>A</td>\n",
       "      <td>B</td>\n",
       "      <td>A</td>\n",
       "      <td>B</td>\n",
       "      <td>D</td>\n",
       "      <td>A</td>\n",
       "      <td>E</td>\n",
       "      <td>E</td>\n",
       "      <td>F</td>\n",
       "      <td>...</td>\n",
       "      <td>0.759875</td>\n",
       "      <td>0.240049</td>\n",
       "      <td>0.298074</td>\n",
       "      <td>0.442475</td>\n",
       "      <td>0.596746</td>\n",
       "      <td>0.414131</td>\n",
       "      <td>0.255382</td>\n",
       "      <td>0.589080</td>\n",
       "      <td>0.311625</td>\n",
       "      <td>7.310482</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>A</td>\n",
       "      <td>B</td>\n",
       "      <td>A</td>\n",
       "      <td>A</td>\n",
       "      <td>B</td>\n",
       "      <td>B</td>\n",
       "      <td>A</td>\n",
       "      <td>E</td>\n",
       "      <td>E</td>\n",
       "      <td>I</td>\n",
       "      <td>...</td>\n",
       "      <td>0.210232</td>\n",
       "      <td>0.329851</td>\n",
       "      <td>0.616663</td>\n",
       "      <td>0.170475</td>\n",
       "      <td>0.263235</td>\n",
       "      <td>0.710961</td>\n",
       "      <td>0.224045</td>\n",
       "      <td>0.285860</td>\n",
       "      <td>0.794931</td>\n",
       "      <td>7.291353</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>5 rows × 25 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "  cat0 cat1 cat2 cat3 cat4 cat5 cat6 cat7 cat8 cat9  ...     cont5     cont6  \\\n",
       "0    A    B    A    C    B    D    A    E    E    G  ...  0.595507  0.286912   \n",
       "1    A    B    A    C    B    D    A    E    C    L  ...  0.479552  0.397436   \n",
       "2    A    B    A    C    B    D    A    E    C    F  ...  0.676395  0.695284   \n",
       "3    A    A    B    A    B    D    A    E    E    F  ...  0.759875  0.240049   \n",
       "4    A    B    A    A    B    B    A    E    E    I  ...  0.210232  0.329851   \n",
       "\n",
       "      cont7     cont8     cont9    cont10    cont11    cont12    cont13  \\\n",
       "0  0.279884  0.202234  0.242654  0.285147  0.264308  0.653654  0.302448   \n",
       "1  0.476742  0.857073  0.516393  0.562065  0.730542  0.318492  0.736251   \n",
       "2  0.253316  0.586934  0.548555  0.836193  0.759788  0.333572  0.273905   \n",
       "3  0.298074  0.442475  0.596746  0.414131  0.255382  0.589080  0.311625   \n",
       "4  0.616663  0.170475  0.263235  0.710961  0.224045  0.285860  0.794931   \n",
       "\n",
       "      Label  \n",
       "0  7.160156  \n",
       "1  8.106445  \n",
       "2  7.132431  \n",
       "3  7.310482  \n",
       "4  7.291353  \n",
       "\n",
       "[5 rows x 25 columns]"
      ]
     },
     "execution_count": 24,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "y_pred.head()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# format data to submit "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {},
   "outputs": [],
   "source": [
    "df_result  = df_test[[\"id\"]]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "metadata": {},
   "outputs": [],
   "source": [
    "df_result[\"target\"] = y_pred[\"Label\"]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>id</th>\n",
       "      <th>target</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>0</td>\n",
       "      <td>7.160156</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>5</td>\n",
       "      <td>8.106445</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>15</td>\n",
       "      <td>7.132431</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>16</td>\n",
       "      <td>7.310482</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>17</td>\n",
       "      <td>7.291353</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   id    target\n",
       "0   0  7.160156\n",
       "1   5  8.106445\n",
       "2  15  7.132431\n",
       "3  16  7.310482\n",
       "4  17  7.291353"
      ]
     },
     "execution_count": 27,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_result.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "metadata": {},
   "outputs": [],
   "source": [
    "df_result.to_csv(\"../data/submission_v3.csv\", index=False)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "metadata": {},
   "outputs": [],
   "source": [
    "# ?setup"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "metadata": {},
   "outputs": [],
   "source": [
    "# ?compare_models"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {},
   "outputs": [],
   "source": [
    "# models()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 36,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "\u001b[0;31mSignature:\u001b[0m\n",
       "\u001b[0mcompare_models\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m\u001b[0m\n",
       "\u001b[0;34m\u001b[0m    \u001b[0minclude\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mUnion\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mList\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mUnion\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mstr\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mAny\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mNoneType\u001b[0m\u001b[0;34m]\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n",
       "\u001b[0;34m\u001b[0m    \u001b[0mexclude\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mUnion\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mList\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mstr\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mNoneType\u001b[0m\u001b[0;34m]\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n",
       "\u001b[0;34m\u001b[0m    \u001b[0mfold\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mUnion\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mint\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mAny\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mNoneType\u001b[0m\u001b[0;34m]\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n",
       "\u001b[0;34m\u001b[0m    \u001b[0mround\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mint\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;36m4\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n",
       "\u001b[0;34m\u001b[0m    \u001b[0mcross_validation\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mbool\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;32mTrue\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n",
       "\u001b[0;34m\u001b[0m    \u001b[0msort\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mstr\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;34m'R2'\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n",
       "\u001b[0;34m\u001b[0m    \u001b[0mn_select\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mint\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;36m1\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n",
       "\u001b[0;34m\u001b[0m    \u001b[0mbudget_time\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mUnion\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mfloat\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mNoneType\u001b[0m\u001b[0;34m]\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n",
       "\u001b[0;34m\u001b[0m    \u001b[0mturbo\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mbool\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;32mTrue\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n",
       "\u001b[0;34m\u001b[0m    \u001b[0merrors\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mstr\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;34m'ignore'\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n",
       "\u001b[0;34m\u001b[0m    \u001b[0mfit_kwargs\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mUnion\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mdict\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mNoneType\u001b[0m\u001b[0;34m]\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n",
       "\u001b[0;34m\u001b[0m    \u001b[0mgroups\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mUnion\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mstr\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mAny\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mNoneType\u001b[0m\u001b[0;34m]\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n",
       "\u001b[0;34m\u001b[0m    \u001b[0mverbose\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mbool\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;32mTrue\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n",
       "\u001b[0;34m\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
       "\u001b[0;31mDocstring:\u001b[0m\n",
       "This function trains and evaluates performance of all estimators available in the \n",
       "model library using cross validation. The output of this function is a score grid \n",
       "with average cross validated scores. Metrics evaluated during CV can be accessed \n",
       "using the ``get_metrics`` function. Custom metrics can be added or removed using \n",
       "``add_metric`` and ``remove_metric`` function.\n",
       "\n",
       "\n",
       "Example\n",
       "--------\n",
       ">>> from pycaret.datasets import get_data\n",
       ">>> boston = get_data('boston')\n",
       ">>> from pycaret.regression import *\n",
       ">>> exp_name = setup(data = boston,  target = 'medv')\n",
       ">>> best_model = compare_models()\n",
       "\n",
       "\n",
       "include: list of str or scikit-learn compatible object, default = None\n",
       "    To train and evaluate select models, list containing model ID or scikit-learn \n",
       "    compatible object can be passed in include param. To see a list of all models \n",
       "    available in the model library use the ``models`` function. \n",
       "\n",
       "\n",
       "exclude: list of str, default = None\n",
       "    To omit certain models from training and evaluation, pass a list containing \n",
       "    model id in the exclude parameter. To see a list of all models available\n",
       "    in the model library use the ``models`` function. \n",
       "\n",
       "\n",
       "fold: int or scikit-learn compatible CV generator, default = None\n",
       "    Controls cross-validation. If None, the CV generator in the ``fold_strategy`` \n",
       "    parameter of the ``setup`` function is used. When an integer is passed, \n",
       "    it is interpreted as the 'n_splits' parameter of the CV generator in the \n",
       "    ``setup`` function.\n",
       "\n",
       "\n",
       "round: int, default = 4\n",
       "    Number of decimal places the metrics in the score grid will be rounded to.\n",
       "\n",
       "\n",
       "cross_validation: bool, default = True\n",
       "    When set to False, metrics are evaluated on holdout set. ``fold`` param\n",
       "    is ignored when cross_validation is set to False.\n",
       "\n",
       "\n",
       "sort: str, default = 'R2'\n",
       "    The sort order of the score grid. It also accepts custom metrics that are\n",
       "    added through the ``add_metric`` function.\n",
       "\n",
       "\n",
       "n_select: int, default = 1\n",
       "    Number of top_n models to return. For example, to select top 3 models use\n",
       "    n_select = 3.\n",
       "\n",
       "\n",
       "budget_time: int or float, default = None\n",
       "    If not None, will terminate execution of the function after budget_time \n",
       "    minutes have passed and return results up to that point.\n",
       "\n",
       "\n",
       "turbo: bool, default = True\n",
       "    When set to True, it excludes estimators with longer training times. To\n",
       "    see which algorithms are excluded use the ``models`` function.\n",
       "\n",
       "\n",
       "errors: str, default = 'ignore'\n",
       "    When set to 'ignore', will skip the model with exceptions and continue.\n",
       "    If 'raise', will break the function when exceptions are raised.\n",
       "\n",
       "\n",
       "fit_kwargs: dict, default = {} (empty dict)\n",
       "    Dictionary of arguments passed to the fit method of the model.\n",
       "\n",
       "\n",
       "groups: str or array-like, with shape (n_samples,), default = None\n",
       "    Optional group labels when 'GroupKFold' is used for the cross validation.\n",
       "    It takes an array with shape (n_samples, ) where n_samples is the number\n",
       "    of rows in the training dataset. When string is passed, it is interpreted \n",
       "    as the column name in the dataset containing group labels.\n",
       "\n",
       "\n",
       "verbose: bool, default = True\n",
       "    Score grid is not printed when verbose is set to False.\n",
       "\n",
       "\n",
       "Returns:\n",
       "    Trained model or list of trained models, depending on the ``n_select`` param.\n",
       "\n",
       "\n",
       "Warnings\n",
       "--------\n",
       "- Changing turbo parameter to False may result in very high training times with \n",
       "  datasets exceeding 10,000 rows.\n",
       "\n",
       "- No models are logged in ``MLFlow`` when ``cross_validation`` parameter is False.\n",
       "\u001b[0;31mFile:\u001b[0m      ~/miniconda3/envs/caret/lib/python3.8/site-packages/pycaret/regression.py\n",
       "\u001b[0;31mType:\u001b[0m      function\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "?compare_models"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 37,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "\u001b[0;31mSignature:\u001b[0m\n",
       "\u001b[0mcompare_models\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m\u001b[0m\n",
       "\u001b[0;34m\u001b[0m    \u001b[0minclude\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mUnion\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mList\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mUnion\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mstr\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mAny\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mNoneType\u001b[0m\u001b[0;34m]\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n",
       "\u001b[0;34m\u001b[0m    \u001b[0mexclude\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mUnion\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mList\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mstr\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mNoneType\u001b[0m\u001b[0;34m]\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n",
       "\u001b[0;34m\u001b[0m    \u001b[0mfold\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mUnion\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mint\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mAny\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mNoneType\u001b[0m\u001b[0;34m]\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n",
       "\u001b[0;34m\u001b[0m    \u001b[0mround\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mint\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;36m4\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n",
       "\u001b[0;34m\u001b[0m    \u001b[0mcross_validation\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mbool\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;32mTrue\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n",
       "\u001b[0;34m\u001b[0m    \u001b[0msort\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mstr\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;34m'R2'\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n",
       "\u001b[0;34m\u001b[0m    \u001b[0mn_select\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mint\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;36m1\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n",
       "\u001b[0;34m\u001b[0m    \u001b[0mbudget_time\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mUnion\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mfloat\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mNoneType\u001b[0m\u001b[0;34m]\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n",
       "\u001b[0;34m\u001b[0m    \u001b[0mturbo\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mbool\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;32mTrue\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n",
       "\u001b[0;34m\u001b[0m    \u001b[0merrors\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mstr\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;34m'ignore'\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n",
       "\u001b[0;34m\u001b[0m    \u001b[0mfit_kwargs\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mUnion\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mdict\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mNoneType\u001b[0m\u001b[0;34m]\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n",
       "\u001b[0;34m\u001b[0m    \u001b[0mgroups\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mUnion\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mstr\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mAny\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mNoneType\u001b[0m\u001b[0;34m]\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n",
       "\u001b[0;34m\u001b[0m    \u001b[0mverbose\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0mbool\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;32mTrue\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n",
       "\u001b[0;34m\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
       "\u001b[0;31mDocstring:\u001b[0m\n",
       "This function trains and evaluates performance of all estimators available in the \n",
       "model library using cross validation. The output of this function is a score grid \n",
       "with average cross validated scores. Metrics evaluated during CV can be accessed \n",
       "using the ``get_metrics`` function. Custom metrics can be added or removed using \n",
       "``add_metric`` and ``remove_metric`` function.\n",
       "\n",
       "\n",
       "Example\n",
       "--------\n",
       ">>> from pycaret.datasets import get_data\n",
       ">>> boston = get_data('boston')\n",
       ">>> from pycaret.regression import *\n",
       ">>> exp_name = setup(data = boston,  target = 'medv')\n",
       ">>> best_model = compare_models()\n",
       "\n",
       "\n",
       "include: list of str or scikit-learn compatible object, default = None\n",
       "    To train and evaluate select models, list containing model ID or scikit-learn \n",
       "    compatible object can be passed in include param. To see a list of all models \n",
       "    available in the model library use the ``models`` function. \n",
       "\n",
       "\n",
       "exclude: list of str, default = None\n",
       "    To omit certain models from training and evaluation, pass a list containing \n",
       "    model id in the exclude parameter. To see a list of all models available\n",
       "    in the model library use the ``models`` function. \n",
       "\n",
       "\n",
       "fold: int or scikit-learn compatible CV generator, default = None\n",
       "    Controls cross-validation. If None, the CV generator in the ``fold_strategy`` \n",
       "    parameter of the ``setup`` function is used. When an integer is passed, \n",
       "    it is interpreted as the 'n_splits' parameter of the CV generator in the \n",
       "    ``setup`` function.\n",
       "\n",
       "\n",
       "round: int, default = 4\n",
       "    Number of decimal places the metrics in the score grid will be rounded to.\n",
       "\n",
       "\n",
       "cross_validation: bool, default = True\n",
       "    When set to False, metrics are evaluated on holdout set. ``fold`` param\n",
       "    is ignored when cross_validation is set to False.\n",
       "\n",
       "\n",
       "sort: str, default = 'R2'\n",
       "    The sort order of the score grid. It also accepts custom metrics that are\n",
       "    added through the ``add_metric`` function.\n",
       "\n",
       "\n",
       "n_select: int, default = 1\n",
       "    Number of top_n models to return. For example, to select top 3 models use\n",
       "    n_select = 3.\n",
       "\n",
       "\n",
       "budget_time: int or float, default = None\n",
       "    If not None, will terminate execution of the function after budget_time \n",
       "    minutes have passed and return results up to that point.\n",
       "\n",
       "\n",
       "turbo: bool, default = True\n",
       "    When set to True, it excludes estimators with longer training times. To\n",
       "    see which algorithms are excluded use the ``models`` function.\n",
       "\n",
       "\n",
       "errors: str, default = 'ignore'\n",
       "    When set to 'ignore', will skip the model with exceptions and continue.\n",
       "    If 'raise', will break the function when exceptions are raised.\n",
       "\n",
       "\n",
       "fit_kwargs: dict, default = {} (empty dict)\n",
       "    Dictionary of arguments passed to the fit method of the model.\n",
       "\n",
       "\n",
       "groups: str or array-like, with shape (n_samples,), default = None\n",
       "    Optional group labels when 'GroupKFold' is used for the cross validation.\n",
       "    It takes an array with shape (n_samples, ) where n_samples is the number\n",
       "    of rows in the training dataset. When string is passed, it is interpreted \n",
       "    as the column name in the dataset containing group labels.\n",
       "\n",
       "\n",
       "verbose: bool, default = True\n",
       "    Score grid is not printed when verbose is set to False.\n",
       "\n",
       "\n",
       "Returns:\n",
       "    Trained model or list of trained models, depending on the ``n_select`` param.\n",
       "\n",
       "\n",
       "Warnings\n",
       "--------\n",
       "- Changing turbo parameter to False may result in very high training times with \n",
       "  datasets exceeding 10,000 rows.\n",
       "\n",
       "- No models are logged in ``MLFlow`` when ``cross_validation`` parameter is False.\n",
       "\u001b[0;31mFile:\u001b[0m      ~/miniconda3/envs/caret/lib/python3.8/site-packages/pycaret/regression.py\n",
       "\u001b[0;31mType:\u001b[0m      function\n"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "?compare_models"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.5"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
